<?php
// echo "<pre>";var_dump($list_poetic);die;
if (empty($list_poetic) == true) {
    echo "Không có dữ liệu tìm kiếm";
} else {
    echo '<table class="table table-hover">';
    echo '<thead>';
    echo '<tr>';
    echo '<th>#</th>';
    echo '<th>Tên bài thơ</th>';
    echo '<th>Thể loại</th>';
    echo '<th>Cập nhật cuối</th>';
    echo '<th>Edit</th>';
    echo '<th>Delete</th>';
    echo '</tr>';
    echo '</thead>';
    echo '<tbody>';
    $cnt = 1;
    foreach ($list_poetic as $poetic) {
        echo '<tr>';
        echo '<th scope="row">' . $cnt . '</th>';
        echo '<td>' . $poetic->caption . '</td>';
        echo '<td>' . $poetic->category_name . '</td>';
        echo '<td>' . $poetic->last_update . '</td>';
        echo '<td><a class="btn btn-default" href="../edit/quan-ly-bai-tho/' . $poetic->id . '" role="button">Edit</a></td>';
        echo '<td><a class="btn btn-default" href="../delete/quan-ly-bai-tho/' . $poetic->id . '" role="button">Delete</a></td>';
        echo '</tr>';
        $cnt++;
    }
    echo '</tbody>';
    echo '</table">';
}
?>
